Converting repetitive if statements into a loop

welcome to shbcf.ru